package com.jxl.controller;

import com.jxl.web.constant.Constant;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * @author 江雪林
 * @create 2021-03-30
 */
@Controller
public class SysController {
    @RequestMapping("{login}")
    public String restful(@PathVariable("login")String url, HttpSession session){
        if(session.getAttribute(Constant.SESSION_USER)!=null){
            return url;
        }else if("register".equals(url)){
            return "register";
        }
        return "login";
    }
}
